import React, { Component } from "react";
import "./sliderBar.scss";

class SliderBar extends Component {
	constructor(props) {
		super(props);
		this.state = {};
	}

	goToSliderPage() {
		this.props.buttCallBack(this.props.comData);
	}

	render() {
		const comData = this.props.comData;
		return (
			<div className="slider_bar">
				<a className="slider-a" onClick={this.goToSliderPage.bind(this)}>
					<img
						src={comData.imgUrl}
						className="slider-img"
						style={{ width: "100%", verticalAlign: "top" }}
						onLoad={() => {
							window.dispatchEvent(new Event("resize"));
							this.setState({ imgHeight: "auto" });
						}}
					/>
				</a>
			</div>
		);
	}
}
export default SliderBar;
